package cn.yuanqiao.archive.detection.domain;

import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.annotation.IdAnnotation;
import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 四性检测详情对象 BJYQ_YQ_INSPECTION_RECORDS_DETAILS
 * 
 * @author xy
 * @date 2023-08-10
 */
public class InspectionLogs extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    public static final String BIGTABLENAME = "_YQ_INSPECTION_RECORDS_DETAILS";

    public InspectionLogs() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
          //  throw new ServiceException("tenantCode is null");
        }else {
            this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
        }
    }

    /** id */
    @IdAnnotation
    private Long id;

    /** pId */
    @Excel(name = "pId")
    private Long pId;

    /** dId */
    @Excel(name = "dId")
    private Long dId;

    /** 检测结果 */
    @Excel(name = "检测结果")
    private String detectionResult;

    private String tableName;

    /** 检测时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "检测时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date detectionTime;

    private String failNum;

    /** 是否默认通过 */
    private String isPass;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setpId(Long pId) 
    {
        this.pId = pId;
    }

    public Long getpId() 
    {
        return pId;
    }
    public void setdId(Long dId) 
    {
        this.dId = dId;
    }

    public Long getdId() 
    {
        return dId;
    }
    public void setDetectionResult(String detectionResult)
    {
        this.detectionResult = detectionResult;
    }

    public String getDetectionResult()
    {
        return detectionResult;
    }
    public void setDetectionTime(Date detectionTime) 
    {
        this.detectionTime = detectionTime;
    }

    public Date getDetectionTime() 
    {
        return detectionTime;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getFailNum() {
        return failNum;
    }

    public void setFailNum(String failNum) {
        this.failNum = failNum;
    }

    public String getIsPass() {
        return isPass;
    }

    public void setIsPass(String isPass) {
        this.isPass = isPass;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("pId", getpId())
            .append("dId", getdId())
            .append("detectionResult", getDetectionResult())
            .append("detectionTime", getDetectionTime())
            .toString();
    }
}
